broadway: Fix return value of get_device_state
authorMatthias Clasen <mclasen@redhat.com>
Wed, 26 Aug 2020 20:24:57 +0000 (16:24 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 26 Aug 2020 21:56:41 +0000 (17:56 -0400)
We need to look a the position, not the child surface.

gdk/broadway/gdksurface-broadway.c

index 50769c7155581b348dc5d9798c67d9581dbb1ab5..bb932ee17fc2c80ebe9a46d1fe1fa33723d4e09c 100644 (file)
@@ -750,15 +750,14 @@ gdk_broadway_surface_get_device_state (GdkSurface      *surface,
                                        double          *y,
                                        GdkModifierType *mask)
 {
-  GdkSurface *child;
-
   g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), FALSE);
 
   if (GDK_SURFACE_DESTROYED (surface))
     return FALSE;
 
-  gdk_broadway_device_query_state (device, surface, &child, x, y, mask);
-  return child != NULL;
+  gdk_broadway_device_query_state (device, surface, NULL, x, y, mask);
+
+  return *x >= 0 && *y >= 0 && *x < surface->width && *y < surface->height;
 }
 
 static void